package cn.yeziji.forum.dao.iupdater;

import cn.yeziji.forum.entity.ForumChatroomEntity;
import cn.yeziji.forum.wrapper.ForumChatroomUpdate;

/**
 * 聊天室更新条件查询器
 *
 * @author gzkemays
 * @since 2022/3/31 10:21
 */
public class ChatroomUpdater {
  public static ForumChatroomUpdate updateChatroomNameById(ForumChatroomEntity entity) {
    return new ForumChatroomUpdate()
        .set
        .chatroom()
        .is(entity.getChatroom())
        .end()
        .where
        .id()
        .eq(entity.getId())
        .end();
  }

  public static ForumChatroomUpdate updateChatroomEntity(ForumChatroomEntity entity) {
    return new ForumChatroomUpdate().set.byEntity(entity).end().where.id().eq(entity.getId()).end();
  }
}
